<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>商品管理</title>
    <meta name="description" content="这是一个商品管理页面">
    <meta name="keywords" content="商品管理">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="${contextPath}/assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="${contextPath}/assets/css/amazeui.datatables.min.css"/>
    <link rel="stylesheet" href="${contextPath}/assets/css/app.css">
    <script src="${contextPath}/assets/js/jquery.min.js"></script>
    <style>
        .am-u-sm-4{height:35px}
        .widget-body{margin-top: -20px}
    </style>
</head>

<body data-type="widgets">
<script src="${contextPath}/assets/js/theme.js"></script>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <#include "/pc/common/header.html"/>
    <!-- 侧边导航栏 -->
    <#include "/pc/common/left.html"/>
    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <ol class="am-breadcrumb widget-head">
                            <li><a href="${contextPath}/index.htm" class="am-icon-home">首页</a></li>
                            <li>商品管理</li>
                            <li>引流商品排序</li>
                        </ol>
                        <div class="widget-body  am-fr">
                            <div class="am-u-sm-12">
                                <em class="am-text-warning">提醒：修改右侧数字即可进行排序</em>
                                <ul class="am-list am-list-border">
                                    <#if list??>
                                        <#list list as l>
                                            <li class="am-g">
                                                <#if l.smImg??>
                                                    <img src="${l.smImg}" class="am-u-sm-2" style="width: 64px;height: 48px;padding-left: 0px;padding-right: 0px">
                                                </#if>
                                                <a href="${contextPath}/product/detail.htm?id=${l.id!}" class="am-u-sm-8">${l.proName!}</a>
                                                <input onchange="sort_b(this)" psid="${l.psid!}" type="number" class="am-u-sm-2" value="${l.sort!}" style="height: 49px;border: 0px;border-left: 1px solid #eef1f5;">
                                            </li>
                                        </#list>
                                    </#if>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<#include "/pc/common/alert.html" />
<script src="${contextPath}/assets/js/amazeui.min.js"></script>
<script src="${contextPath}/assets/js/amazeui.datatables.min.js"></script>
<script src="${contextPath}/assets/js/dataTables.responsive.min.js"></script>
<script src="${contextPath}/assets/js/amazeui.page.js"></script>
<script src="${contextPath}/assets/js/app.js"></script>
<script>
    function sort_b(obj) {
        var psid = $(obj).attr("psid");
        var sort = $(obj).val();
        $.ajax({
            url: "${contextPath}/product/saveSort.htm?id=" + psid + "&sort=" + sort,
            type: "get",
            dataType: "json",
            success: function (data) {
                var json = $.parseJSON(data);
                if(!json.isSuccess){
                    Malert(json.errMessage, function () {
                    });
                }
                location.reload();
            }
        });
    }
</script>
</body>

</html>